# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=libwmf
pkgver=0.2.13
pkgrel=1
pkgdesc="A library for reading vector images in Microsoft's native Windows Metafile Format (WMF)"
arch=('x86_64')
url="http://wvware.sourceforge.net/libwmf.html"
license=('LGPL')
depends=('libx11' 'libjpeg' 'gsfonts' 'freetype2' 'expat')
makedepends=('gtk2' 'libxt')
optdepends=('gdk-pixbuf2: for pixbuf loader')
options=('!docs' '!emptydirs')
source=($pkgname-$pkgver.tar.gz::https://github.com/caolanm/libwmf/archive/v$pkgver.tar.gz)
sha256sums=('18ba69febd2f515d98a2352de284a8051896062ac9728d2ead07bc39ea75a068')

prepare() {
  cd ${pkgname}-${pkgver}
  autoreconf -fi
} 

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr \
              --with-gsfontdir=/usr/share/fonts/Type1 \
	      --with-fontdir=/usr/share/fonts/Type1 \
	      --with-gsfontmap=/usr/share/ghostscript/9.10/Resource/Init/Fontmap.GS
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR="${pkgdir}" install -j1
  #Remove fonts, these are in gsfonts
  rm -rf "${pkgdir}/usr/share/fonts"
}
